package com.apy.accountbook.model

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query

@Dao
interface BillDao {
    @Insert
    suspend fun insert(bill: Bill)

    @Query("SELECT * FROM bills WHERE date(create_at/1000, 'unixepoch', 'localtime') = date('now', 'localtime') ORDER BY create_at DESC")
    suspend fun getTodayBills(): List<Bill>

    @Query("SELECT * FROM bills order by id desc")
    suspend fun getAll(): List<Bill>
}
